<!-- 批发采购收货页面 -->
<template>
  <div class="paying-box">
    <div class="main">
      <p>
        <img src="@assets/img/agin.png" alt />
        <span>若已支付成功，请勿进行重复支付</span>
      </p>
      <div class="main-button">
        <el-button type="primary" @click="paySuccess">
          完成支付
        </el-button>
        <el-button style="border-color:#2371C5;color:#2371C5;" plain @click="payAgain">
          重新支付
        </el-button>
      </div>
    </div>
  </div>
</template>

<script>
import { findPaymentStatus } from '@api/m_mall_web_v1.js';
export default {
  data() {
    return {
      orderId: '',
      seqNo: ''
    };
  },
  mounted() {
    this.orderId = this.$route.query.id;
    this.seqNo = this.$route.query.seqNo;
  },
  methods: {
    payAgain() {
      this.$axios
        .$post(findPaymentStatus, {
          orderId: this.orderId,
          seqNo: this.seqNo
        })
        .then(res => {});
      this.$router.replace({
        path: '/financial-management/accounts-payable-managemen/list'
      });
    },
    paySuccess() {
      this.$axios
        .$post(findPaymentStatus, {
          orderId: this.orderId,
          seqNo: this.seqNo
        })
        .then(res => {});
      this.$router.replace({
        path: '/financial-management/accounts-payable-managemen/detail',
        query: {
          id: this.orderId
        }
      });
    }
  }
};
</script>

<style lang="less">
.paying-box {
  display: flex;
  justify-content: center;
  align-items: center;
  .main {
    // border: 1px solid;
    p {
      font-size: 16px;
      display: flex;
      align-items: center;
      height: 30px;
      justify-content: center;
      color: #333333;
      img {
        margin-right: 8px;
      }
    }
    .main-button {
      width: 400px;
      margin-top: 50px;
      display: flex;
      justify-content: space-between;
      .el-button {
        width: 130px;
      }
    }
  }
}
</style>
